<?php /* SVN: $Id: $ */ ?>
<div class="projectFlagCategories index js-response">



<ul class="filter-list-block record-info js-pagination clearfix">
    <li <?php if (!empty($this->request->params['named']['filter_id']) && $this->request->params['named']['filter_id'] == ConstMoreAction::Active) { echo 'class="active"';} ?>><span class="purple-block" title="<?php echo __l('Approved Records'); ?>"><?php echo $this->Html->link($this->Html->cInt($approved,false).'<span>' .__l('Approved Records'). '</span>', array('controller'=>'project_flag_categories','action'=>'index','filter_id' => ConstMoreAction::Active), array('escape' => false));?></span> </li>
    <li <?php if (!empty($this->request->params['named']['filter_id']) && $this->request->params['named']['filter_id'] == ConstMoreAction::Inactive) { echo 'class="active"';} ?>><span class="red-block" title="<?php echo __l('Disapproved Records'); ?>"><?php echo $this->Html->link($this->Html->cInt($pending,false).'<span>' .__l('Disapproved Records'). '</span>', array('controller'=>'project_flag_categories','action'=>'index','filter_id' => ConstMoreAction::Inactive), array('escape' => false));?></span> </li>
    <li <?php if (empty($this->request->params['named']['filter_id'])) { echo 'class="active"';} ?>><span class="blue-block" title="<?php echo __l('Total Records'); ?>"><?php echo $this->Html->link($this->Html->cInt($pending + $approved,false).'<span>' .__l('Total Records'). '</span>', array('controller'=>'project_flag_categories','action'=>'index'), array('escape' => false));?></span> </li>
</ul>

<div class="page-count-block clearfix">
	    <div class="grid_left">
	      <?php echo $this->element('paging_counter'); ?>
		</div>
		<div class="grid_left">
    <?php echo $this->Form->create('ProjectFlagCategory', array('type' => 'get', 'class' => 'normal search-form', 'action'=>'index')); ?>
    <?php echo $this->Form->input('filter_id',array('type'=>'select', 'empty' => __l('Please Select'))); ?>
    <?php echo $this->Form->submit(__l('Search'));?>
    <?php echo $this->Form->end();?>
		</div>
        <div class="add-block grid_right">
        <?php echo $this->Html->link(__l('Add'), array('controller' => 'project_flag_categories', 'action' => 'add'), array('class' => 'add','title' => __l('Add'))); ?>
       </div>
  </div>
<?php
    echo $this->Form->create('ProjectFlagCategory' , array('class' => 'normal','action' => 'update'));
    echo $this->Form->input('r', array('type' => 'hidden', 'value' => $this->request->url));

?>
<table class="list">
    <tr>
        <th class="actions"><?php echo __l('Select'); ?></th>
        <th class="actions"><?php echo __l('Actions');?></th>
        <th class="dl"><div class="js-pagination"><?php echo $this->Paginator->sort(__l('Name'), 'name');?> </div></th>
        <th><div class="js-pagination"><?php echo $this->Paginator->sort(__l('Project Flags'), 'project_flag_count');?></div></th>
        
    </tr>
<?php
if (!empty($projectFlagCategories)):

$i = 0;
foreach ($projectFlagCategories as $projectFlagCategory):
	$class = null;
	if ($i++ % 2 == 0) :
		$class = ' class="altrow"';
	endif;
                if($projectFlagCategory['ProjectFlagCategory']['is_active']):
            		$status_class = 'js-checkbox-active';
            		$active_class = ' class="active-record"';
            	else:
            		$status_class = 'js-checkbox-inactive';
            		$active_class = ' class="inactive-record"';
            	endif;
                ?>
	<tr<?php echo $active_class;?>>
     <td><?php echo $this->Form->input('ProjectFlagCategory.'.$projectFlagCategory['ProjectFlagCategory']['id'].'.id', array('type' => 'checkbox', 'id' => "admin_checkbox_".$projectFlagCategory['ProjectFlagCategory']['id'], 'label' => false, 'class' => $status_class.' js-checkbox-list')); ?></td>
    
			<td class="actions dl">
            <div class="action-block">
                <span class="action-information-block">
                    <span class="action-left-block">&nbsp;&nbsp;</span>
                        <span class="action-center-block">
                            <span class="action-info">
                                <?php echo __l('Action');?>
                             </span>
                        </span>
                    </span>
                    <div class="action-inner-block">
                    <div class="action-inner-left-block">
                        <ul class="action-link clearfix">
                        <li><?php echo $this->Html->link(__l('Edit'), array('action' => 'edit', $projectFlagCategory['ProjectFlagCategory']['id']), array('class' => 'edit js-edit', 'title' => __l('Edit')));?></li>
                         <li><?php echo $this->Html->link(__l('Delete'), array('action' => 'delete', $projectFlagCategory['ProjectFlagCategory']['id']), array('class' => 'delete js-delete', 'title' => __l('Delete')));?></li>
                                     		 </ul>
    					</div>
    					<div class="action-bottom-block"></div>
    				  </div>
              </div>
        </td>
		<td class="dl"><?php echo $this->Html->cText($projectFlagCategory['ProjectFlagCategory']['name']);?></td>
<!--		
         <td>
						<?php
							if(!empty($gigFlagCategory['GigFlag'])):
								echo $this->Html->link($this->Html->cInt(count($gigFlagCategory['GigFlag']), false), array('controller' => 'gig_flags', 'action' => 'index', 'category' => $gigFlagCategory['GigFlagCategory']['id']));
							else:
								echo '0';
							endif;
						?>
					</td>-->
        <td><?php echo $this->Html->link($this->Html->cInt($projectFlagCategory['ProjectFlagCategory']['project_flag_count']), array('controller'=> 'projects', 'action'=>'index', 'project_flag_category_id'=> $projectFlagCategory['ProjectFlagCategory']['id']), array('escape' => false)); ?></td>
		
	</tr>
<?php
    endforeach;
else:
?>
	<tr>
		<td colspan="8" class="notice"><?php echo __l('No Project Flag Categories available');?></td>
	</tr>
<?php
endif;
?>
</table>
<?php
    if (!empty($projectFlagCategories)):
        ?>
        <div class="clearfix">
	<div class="admin-select-block grid_left">
			<?php echo __l('Select:'); ?>
			<?php echo $this->Html->link(__l('All'), '#', array('class' => 'js-admin-select-all', 'title' => __l('All'))); ?>
			<?php echo $this->Html->link(__l('None'), '#', array('class' => 'js-admin-select-none', 'title' => __l('None'))); ?>
			<?php echo $this->Html->link(__l('Inactive'), '#', array('class' => 'js-admin-select-pending', 'title' => __l('Inactive'))); ?>

        </div>
        <div class="admin-checkbox-button grid_4 grid_left">
            <?php echo $this->Form->input('more_action_id', array('class' => 'js-admin-index-autosubmit', 'label' => false, 'empty' => __l('-- More actions --'))); ?>
        </div>
        <div class="js-pagination grid_right">
            <?php echo $this->element('paging_links'); ?>
        </div>
        </div>
        <div class="hide">
            <?php echo $this->Form->submit('Submit');  ?>
        </div>
        <?php
    endif;
    echo $this->Form->end();
    ?>
</div>